﻿using DLog.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DLog.ILog
{
    public interface ILogger
    {
        /// <summary>
        /// 初始化日志
        /// </summary>
        /// <param name="target"></param>
        /// <param name="addition"></param>
        void Init(string target, string addition);
        /// <summary>
        /// 最常见的记录信息，一般用于普通输出
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Trace(string message);
        /// <summary>
        /// 最常见的记录信息，一般用于普通输出
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Trace(Exception ex);
        /// <summary>
        /// 最常见的记录信息，一般用于普通输出
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Trace(string message, Exception ex);
        /// <summary>
        /// 同样是记录信息，不过出现的频率要比Trace少一些，一般用来调试程序
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Debug(string message);
        /// <summary>
        /// 同样是记录信息，不过出现的频率要比Trace少一些，一般用来调试程序
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Debug( Exception ex);
        /// <summary>
        /// 同样是记录信息，不过出现的频率要比Trace少一些，一般用来调试程序
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Debug(string message, Exception ex);
        /// <summary>
        /// 信息类型的消息
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Info(string message);
        /// <summary>
        /// 信息类型的消息
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Info(Exception ex);
        /// <summary>
        /// 信息类型的消息
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Info(string message, Exception ex);
        /// <summary>
        /// 警告信息，一般用于比较重要的场合
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Warn(string message);
        /// <summary>
        /// 警告信息，一般用于比较重要的场合
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Warn(Exception ex);
        /// <summary>
        /// 警告信息，一般用于比较重要的场合
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Warn(string message, Exception ex); 
        /// <summary>
        /// 错误信息
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Error(string message);
        /// <summary>
        /// 错误信息
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Error(Exception ex);
        /// <summary>
        /// 错误信息
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Error(string message, Exception ex);
        /// <summary>
        /// 致命异常信息。一般来讲，发生致命异常之后程序将无法继续执行。
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Fatal(string message);
        /// <summary>
        /// 致命异常信息。一般来讲，发生致命异常之后程序将无法继续执行。
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Fatal( Exception ex);
        /// <summary>
        /// 致命异常信息。一般来讲，发生致命异常之后程序将无法继续执行。
        /// </summary>
        /// <param name="message"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        bool Fatal(string message, Exception ex);
        /// <summary>
        /// 通过等级来记录日志信息
        /// </summary>
        /// <param name="meesage"></param>
        /// <param name="logLevel"></param>
        /// <returns></returns>
        bool Log(string meesage, int logLevel);
       /// <summary>
        /// 通过等级来记录日志信息
       /// </summary>
       /// <param name="ex"></param>
       /// <param name="logLevel"></param>
       /// <returns></returns>
        bool Log(Exception ex, int logLevel);
        /// <summary>
        /// 通过等级来记录日志信息
        /// </summary>
        /// <param name="meesage"></param>
        /// <param name="ex"></param>
        /// <param name="logLevel"></param>
        /// <returns></returns>
        bool Log(string meesage, Exception ex, int logLevel);
        /// <summary>
        /// 通过日志编号获得日志信息
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        LogModel GetLog(int LogId);
        /// <summary>
        /// 通过日志等级获得某一页的数据
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(int logLevel, int pageIndex, int pageSize);
        /// <summary>
        /// 通过创建时间区间得某一页的数据
        /// </summary>
        /// <param name="CreateStartDate"></param>
        /// <param name="CreateEndDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(DateTime CreateStartDate, DateTime CreateEndDate, int pageIndex, int pageSize);
        /// <summary>
        /// 通过日志等级和创建时间区间获得某一页的数据
        /// </summary>
        /// <param name="logLevel"></param>
        /// <param name="CreateStartDate"></param>
        /// <param name="CreateEndDate"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="totalCount"></param>
        /// <returns></returns>
        List<LogModel> GetLogs(int logLevel, DateTime CreateStartDate, DateTime CreateEndDate, int pageIndex, int pageSize);
        /// <summary>
        /// 删除日志信息
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        bool DeleteModel(int LogId);
        /// <summary>
        /// 删除系列日志信息
        /// </summary>
        /// <param name="LogId"></param>
        /// <returns></returns>
        bool DeleteList(List<int> LogId);
    }
}
